package org.benjamin.lending.service;

import org.benjamin.lending.domain.entity.LoginLog;
import org.benjamin.lending.domain.entity.MemberIdentity;
import org.benjamin.lending.domain.entity.MemberInfo;
import org.benjamin.lending.domain.entity.MemberMoney;
import org.benjamin.lending.domain.entity.MemberMoneyLog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户会员操作服务提供接口
 * @author 黄文杰
 *
 */
public interface MemberService {
	
	/**
	 * 注册用户
	 * @param memberInfo
	 * @return
	 */
	MemberInfo registerMember(MemberInfo memberInfo,String recommendCode);

	/**
	 * 用户登录
	 * @param username
	 * @return
	 */
	MemberInfo userLogin(String username);
	
	MemberInfo getEntityId(Integer id,boolean loadMoney);

	MemberIdentity findIdentityByUsername(String username);

	MemberMoney findByMoneyByUsername(String username);

	Page<MemberInfo>  findMemberAll(Pageable pageable);

    void memberIdentitySuccess(Integer userId, String realName, String idNumber, String token,String pictureData);

    void memberMoneyChange(Integer uid, BigDecimal amount, MemberMoneyLog.Type type, String createIp);

	void memberMoneyChange(MemberInfo memberInfo, BigDecimal amount, MemberMoneyLog.Type type, String createIp);

    Page<MemberMoneyLog> findByMoneyLogsByUserId(Integer id,Pageable pageable);
    
    Page<LoginLog> findLoginLog(String username);
}
